USE [OctoNetApps]
GO

/****** Object:  Table [classified].[ClassifiedCategories]    Script Date: 05/25/2011 06:48:49 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [classified].[ClassifiedCategories](
	[CategoryID] [bigint] NOT NULL,
	[ResourceID] [bigint] NOT NULL,
	[ParentCategoryID] [bigint] NULL,
	[CategoryName] [nvarchar](100) NOT NULL,
	[AdNameExample] [nvarchar](512) NULL,
	[ImageUrl] [varchar](512) NULL,
	[RedirectUrl] [varchar](512) NULL,
	[Time] [smalldatetime] NOT NULL,
	[ReadOnly] [bit] NOT NULL,
 CONSTRAINT [PK_ClassifiedCategories] PRIMARY KEY CLUSTERED 
(
	[CategoryID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [classified].[ClassifiedCategories]  WITH CHECK ADD  CONSTRAINT [FK_ClassifiedCategories_ClassifiedResources] FOREIGN KEY([ResourceID])
REFERENCES [classified].[ClassifiedResources] ([ResourceID])
GO

ALTER TABLE [classified].[ClassifiedCategories] CHECK CONSTRAINT [FK_ClassifiedCategories_ClassifiedResources]
GO

ALTER TABLE [classified].[ClassifiedCategories] ADD  CONSTRAINT [DF_AdCategories_Time]  DEFAULT (getutcdate()) FOR [Time]
GO


